<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<body>
<header th:fragment="header">
    <div class="header">
        <div class="main">
            <a class="logo" href="/" title="Fly">Fly社区</a>
            <div class="nav">
                <a class="nav-this" href="index.html" th:href="@{/}">
                    <i class="iconfont icon-wenda"></i>问答
                </a>
                <a href="https://github.com/fanpan26/SpringBootLayIM" class="nav-this" target="_blank">
                    <i class="iconfont icon-daima"></i>源码
                </a>
            </div>

            <div class="nav-user" th:if="false">
                <!-- 未登入状态 -->
                <a class="unlogin" href="user/login.html"><i class="iconfont icon-touxiang"></i></a>
                <span><a href="user/login.html" th:href="@{/account/login}">登入</a><a href="user/reg.html" th:href="@{/account/reg}">注册</a></span>
                <p class="out-login">
                    <a href="" onclick="layer.msg('正在通过QQ登入', {icon:16, shade: 0.1, time:0})" class="iconfont icon-qq" title="QQ登入"></a>
                    <a href="" onclick="layer.msg('正在通过微博登入', {icon:16, shade: 0.1, time:0})" class="iconfont icon-weibo" title="微博登入"></a>
                </p>
            </div>

            <div class="nav-user" th:if="${session.user!=null}">
                <a class="avatar" href="user/index.html" th:href="@{/user/{id}(id=${session.user.userid})}">
                    <img th:src="${session.user.avatar}"/>
                    <cite th:text="${session.user.username}"></cite>
                    <!--<i>VIP2</i>-->
                </a>
                <div class="nav">
                    <a href="/user/set/" th:href="@{/user/set}"><i class="iconfont icon-shezhi"></i>设置</a>
                    <a href="/a/logout/" th:href="@{/account/logout}"><i class="iconfont icon-tuichu" style="top: 0; font-size: 22px;"></i>退了</a>
                </div>
            </div>
        </div>
    </div>
</header>
</body>
</html>